package pl.edu.pk.mech.kkbus.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import pl.edu.pk.mech.kkbus.model.DepartureTime;
import pl.edu.pk.mech.kkbus.repository.DepartureDAO;

import static pl.edu.pk.mech.kkbus.staticstrings.NameEntity.NAME_ENTITY_DEPARTURE;

public class DepartureService {

	@Autowired
	DepartureDAO departureDAO;
	
	public List<DepartureTime> getAllDepartures(){
		return departureDAO.getAllDepartures();
	}
	
	public boolean createOrUpdateDeparture(DepartureTime departureTime){
		return departureDAO.createOrUpdate(departureTime, NAME_ENTITY_DEPARTURE, departureDAO);
	}
	
	public DepartureTime getDeparture(long id){
		return departureDAO.getDeparture(id);
	}
}
